/*
 * VectorUnigramas.h
 *
 *  Created on: Dec 8, 2014
 *      Author: ale
 */

#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <cmath>
#include "FastHash.h"

using namespace std;

#ifndef PRED_VECTORUNIGRAMAS_H_
#define PRED_VECTORUNIGRAMAS_H_

class VectorUnigramas {
public:
	VectorUnigramas();
	virtual ~VectorUnigramas();

	size_t tam;

	vector<string> vocab;
	vector<double> probs;
	vector<double> boffs;

	vector<istream::streampos> offsets;

	vector<unsigned int> mejor_bigrama_que_lo_completa; //(solo la segunda palabra)

	unsigned int buscarUnigrama(string unigrama, size_t len);
	bool existeUnigrama(string unigrama, size_t len);
	unsigned int agregarUnigrama(string unigrama, double prob, double boff);
	double obtenerProbabilidad(string unigrama);
	double obtenerBackOff(string unigrama);

	unsigned int obtenerHash(const char* unigrama, size_t len);

	void agregarOffsetDeAenBigramas(string A, istream::streampos offset);

	void agregarMejorBigramaQueCompleta(string A, string palabraSiguiente);
};

#endif /* PRED_VECTORUNIGRAMAS_H_ */
